<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/RepairRecord/repairRecordStep" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="repairRecordStep" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="woId1" value="${params.woId1}"></g:hiddenField>
            %{--<label >时间段：</label>&nbsp;
            <input type="text" name="startTime" value="${startTime}" data-pattern="yyyy-MM-dd"  data-toggle="datepicker" placeholder="FROM">
            <input type="text" name="endTime" value="${endTime}" data-pattern="yyyy-MM-dd" data-toggle="datepicker" placeholder="TO">&nbsp;&nbsp;
            <label >维修工单号：</label>&nbsp;
            <g:select name="woId" from="${repairRecordWoId}" data-toggle="selectpicker" data-live-search="true" optionKey="doc_id" optionValue="doc_id" value="${woId}" noSelection="['':'ALL']" />&nbsp;
            <label >存货编码/图号：</label>&nbsp;
            <g:select name="part" from="${repairRecordPart}" data-toggle="selectpicker" data-live-search="true" optionKey="part" optionValue="part" value="${part}" noSelection="['':'ALL']" />&nbsp;
            <label >状态：</label>&nbsp;
            <g:select name="state" from="${repairRecordState}" data-toggle="selectpicker" data-live-search="true" optionKey="state" optionValue="state" value="${state}" noSelection="['':'ALL']" />&nbsp;--}%

            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/StageWip/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="panel-body">

    <div style="mini-width:400px;height:450px;" id="cellGlassOutputDiv"></div>
</div>

<div class="bjui-pageContent">
    <g:if test="${repairRecordStep.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${repairRecordStep.size()>0}">
                <g:each in="${repairRecordStep}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='REPAIR_HOST_TIME'&&headInstance!='RN'}">
                                <td name="tdtimeStep${i}">${dataInstance["${headInstance}"] }</td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td name="td${i}${j}">${dataInstance["${headInstance}"] }</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            <tr>
                <td colspan="11">小计</td>
                <td name="stepTimeSum"></td>
            </tr>
            <tr>
                <td colspan="11">合计</td>
                <td>${repairRecordStepSum[0].SUM_TIME}</td>
            </tr>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/51pagination" />

<script>
    $(function(){

        var stepTimeSum=0;

        for(var i=0;i<${repairRecordStep.size()};i++){

            var times='tdtimeStep'+i
            var sumStepTime=$("td[name='"+times+"']").text()==''?0:parseInt($("td[name='"+times+"']").text())
            stepTimeSum+=sumStepTime
        }


        $("td[name='stepTimeSum']").html(stepTimeSum);

    })
</script>